package com.tmri.clean.init;

import org.csource.fastdfs.ClientGlobal;

import java.io.File;
import java.io.FileReader;
import java.io.InputStream;
import java.util.Properties;

/**
 * @Description TODO
 * @Date 2021/10/19 11:03
 * @Created by xielx
 */
public class CleanProperties {
    private final static Properties properties = new Properties();


    public static void init() throws Exception {
        File confFile = new File("conf/application.properties");
        if (confFile.exists()) {
            System.out.println("正在加载："+confFile.getPath()+"的配置文件");
            FileReader fr = new FileReader(confFile);
            properties.load(fr);
            fr.close();
        }else{
            InputStream res = CleanProperties.class.getClassLoader().getResourceAsStream("application.properties");
            properties.load(res);
            res.close();
        }
        ClientGlobal.initByProperties(properties);
        OracleHandler.init(properties);
    }

}
